package dao.interfaces;

import engine.Unit;
import java.util.ArrayList;

/**
 * A data access object interface for units.
 * @author Johnny
 */
public interface UnitDao {

    /**
     * Returns the list of units.
     * @return the list of units.
     */
    public ArrayList<Unit> getUnits();

    /**
     * Adds a new unit to the datasource.
     * @param name the unit's name.
     * @return the newly created unit.
     */
    public Unit addUnit(String name);

    /**
     * Deletes a unit from the datasource.
     * @param unitId the id of the unit to be deleted.
     */
    public void removeUnit(int unitId);

    /**
     * Updates a unit's attributes (name) in the datasource.
     * @param unit the unit containing the modified name.
     */
    public void updateUnit(Unit unit);

    /**
     * Adds a node to a unit's course list.
     * @param unitId the id of the unit that will be modified.
     * @param nodeId the id of the node that will be added.
     */
    public void addToCourse(int unitId, int nodeId);

    /**
     * Removes a node from the unit's course list.
     * @param unitId the id of the unit that will be modified.
     * @param nodeId the id of the node that will be removed from the course.
     */
    public void removeFromCourse(int unitId, int nodeId);
}
